package com.shujiaotong.pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author author
 * @since 2024-10-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user_card")
@ApiModel(value="UserCard对象", description="")
public class UserCard implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "用户主键")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty(value = "卡主键")
    @TableField("card_id")
    private Long cardId;

    @ApiModelProperty(value = "卡名(冗余字段)")
    @TableField("card_name")
    private String cardName;

    @ApiModelProperty(value = "课程权限")
    @TableField("tags")
    private String tags;

    @ApiModelProperty(value = "卡的类型")
    @TableField("type")
    private String type;

    @ApiModelProperty(value = "次卡剩余次数")
    @TableField("count")
    private Integer count;

    @ApiModelProperty(value = "开始时间")
    @TableField("start_date")
    private LocalDate startDate;

    @ApiModelProperty(value = "结束时间")
    @TableField("end_date")
    private LocalDate endDate;

    @ApiModelProperty(value = "状态 1正常 2次数用尽 3过期")
    @TableField("status")
    private Integer status;

    //创建时间
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    //更新时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    //创建人
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    //修改人
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;

    @TableField("is_deleted")
    private Integer isDeleted;

    @TableField("image")
    private String image;

    @TableField("price")
    private Double price;

    @TableField(exist = false)
    private boolean disabled;
}
